{template 'common/header'}
<div class="main">
	<form action="" method="post" class="form-horizontal form" id="setting-form">
		<div class="panel panel-default">
			<div class="panel-heading">参数设置</div>
			<div class="panel-body">
				<ul class="nav nav-tabs" id="myTab">
					<li class="active"><a href="#tab_share">分享设置</a></li>
					<li><a href="#tab_param">返利设置</a></li>
					<li><a href="#tab_param1">通知设置</a></li>
					<li><a href="#tab_param2">商城信息设置</a></li>
					<li><a href="#tab_param3">支付参数设置</a></li>
					<li><a href="#tab_followed">引导关注设置</a></li>
				</ul>
				<div class="tab-content">
					<div class="tab-pane active" id="tab_share">
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">分享标题</label>
							<div class="col-sm-8">
								<input type="text" name="share_title" class="form-control" value="{$settings['share_title']}" />
							</div>
						</div>
						
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">分享图片</label>
							<div class="col-sm-8">
								{php echo tpl_form_field_image('share_image', $settings['share_image']);}
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">分享描述</label>
							<div class="col-sm-8">
								<input type="text" name="share_desc" class="form-control" value="{$settings['share_desc']}" />
							</div>
						</div>
					</div>
					<!--返利设置-->
					<div class="tab-pane" id="tab_param">
						<div class="panel-body">
				            <div class="form-group">
				                <label class="col-xs-12 col-sm-3 col-md-2 control-label">返利等级</label>
				                <div class="col-sm-9 col-xs-12">
				                    <select class="form-control" name="level">
				                        <option value="0" selected="">不开启返利机制</option>
				                        <option value="1" {if $settings['level']==1}selected="selected" {/if}>一级返利</option>
				                        {if WELIAM_INDIANA_VERSION=='special'}
				                       <option value="2" {if $settings['level']==2}selected="selected" {/if}>二级返利</option>
				                        <option value="3" {if $settings['level']==3}selected="selected" {/if}>三级返利</option>
				                   		{/if}
				                    </select>
				                </div>
				            </div>
				            <div class="form-group">
				                <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
				                <div class="col-sm-9 col-xs-12">
				                    <div class="input-group">
				                        <div class="input-group-addon">一级返利</div>
				                        <input type="text" name="level1" class="form-control" value="{$settings['level1']}">
				                        <div class="input-group-addon">积分</div>
				                    </div>
				                </div>
				            </div>
				              {if WELIAM_INDIANA_VERSION=='special'}
				            <div class="form-group">
				                <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
				                <div class="col-sm-9 col-xs-12">
				                    <div class="input-group">
				                        <div class="input-group-addon">二级返利</div>
				                        <input type="text" name="level2" class="form-control" value="{$settings['level2']}">
				                        <div class="input-group-addon">积分</div>
				                    </div>
				                </div>
				            </div>
				
				            <div class="form-group">
				                <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
				                <div class="col-sm-9 col-xs-12">
				                    <div class="input-group">
				                        <div class="input-group-addon">三级返利</div>
				                        <input type="text" name="level3" class="form-control" value="{$settings['level3']}">
				                        <div class="input-group-addon">积分</div>
				                    </div>
				                </div>
				            </div>
				            {/if}
				            <div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">邀请图片</label>
								<div class="col-xs-12 col-sm-8">
						{php echo tpl_form_field_image('invitepicarr', $this->module['config']['invitepicarr']);}
									<span class="help-block"></span>
								</div>
							</div>
							
				            <div class="form-group">
					            <label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">积分兑换</label>
								<div class="col-xs-12 col-sm-4 input-group" style="float: left;">
		                            <input type="text" name="credit1" class="form-control" value="{$settings['credit1']}">
		                            <span class="input-group-addon">积分 兑换</span>
		                            <input type="text" name="credit2" class="form-control" value="{$settings['credit2']}">
		                            <span class="input-group-addon">夺宝币</span>
	                      		</div>	
	                      		<div class="col-xs-12 col-sm-8" style="width: 33.3%;">
		                            <label class="radio radio-inline">
										<input type="radio" name="creditstatus" value="1" {if $settings['creditstatus']==1}checked="checked"{/if}> 关闭
									</label>
									<label class="radio radio-inline">
										<input type="radio" name="creditstatus" value="2" {if $settings['creditstatus']==2}checked="checked"{/if}> 开启
									</label>
								</div>
                      		</div>
				        </div>
					</div>
					<div class="tab-pane" id="tab_param1">
						<div class="panel panel-warning">
							<div class="panel-heading">购买成功模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_pay" class="form-control" value="{$settings['m_pay']}" />
										<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——TM00001[名称：购买成功通知]</span>
									</div>
								</div>
							</div>
						</div>
						<div class="panel panel-info">
							<div class="panel-heading">订单发货模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_send" class="form-control" value="{$settings['m_send']}" />
										<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——OPENTM200565259[名称:订单发货提醒]</span>
									</div>
								</div>
							</div>
						</div>
						<div class="panel panel-info">
							<div class="panel-heading">中奖结果模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_suc" class="form-control" value="{$settings['m_suc']}" />
										<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——OPENTM204632492[名称:中奖结果通知]</span>
									</div>
								</div>
							</div>
						</div>
						<div class="panel panel-danger">
							<div class="panel-heading">退款模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_ref" class="form-control" value="{$settings['m_ref']}" />
										<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——TM00004[名称:退款通知]</span>
									</div>
								</div>
							</div>
						</div>
						<div class="panel panel-danger">
							<div class="panel-heading">提现模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_money" class="form-control" value="{$settings['m_money']}" />
										<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——TM00980[名称:提现成功通知]</span>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="tab-pane" id="tab_param2">
						<div class="form-group">
		                    <label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板选择</label>
		                    <div class="col-sm-8 col-xs-12">
		                        <select class='form-control' name='style'>
		                            {loop $styles  $style}
		                            <option value='{$style}' {if $style==$settings['style']}selected{/if}>{$style}</option>
		                            {/loop}
		                        </select>
		                    </div>
		                </div> 
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">商城名称</label>
							<div class="col-xs-12 col-sm-8">
								<input type="text" name="sname" class="form-control" value="{$settings['sname']}" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">首页商品进度显示方式</label>
							<div class="col-xs-12 col-sm-8" style="width: 33.3%;">
		                            <label class="radio radio-inline">
										<input type="radio" name="showtype" value="1" {if $settings['showtype']==1}checked="checked"{/if}> 百分比
									</label>
									<label class="radio radio-inline">
										<input type="radio" name="showtype" value="2" {if $settings['showtype']==2}checked="checked"{/if}> 次数
									</label>
								</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">版权信息</label>
							<div class="col-xs-12 col-sm-8">
								<input type="text" name="copyright" class="form-control" value="{$settings['copyright']}" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">特别说明</label>
							<div class="col-xs-12 col-sm-8">
								<input type="text" name="instruction" class="form-control" value="{$settings['instruction']}" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">规则介绍</label>
							<div class="col-sm-8 col-xs-12">
								{php echo tpl_ueditor('content', $settings['content']);}
								<span class="help-block">为空则为默认介绍</span>
							</div>
						</div>
					</div>
					<!--
                    	作者：916345570@qq.com
                    	时间：2016-01-20
                    	描述：ping++支付参数设置开始
                    -->
					<div class="tab-pane" id="tab_param3">
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">支付支付接口</label>
							<div class="col-xs-12 col-sm-8">
								<div class="alert alert-warning">
									为防止您的微信支付被封，建议您采用云支付接口 <a href="http://www.yunpay.net.cn/" target="_blank">申请及详情请查看这里</a>.
								</div>
								<label class="radio radio-inline" onclick="$('#pingxx').hide();$('#wqpay').show();">
									<input type="radio" name="paytype" value="1" {if intval($settings['paytype']) == 1}checked="checked"{/if}> 系统支付接口
								</label>
								<label class="radio radio-inline" onclick="$('#pingxx').show();$('#wqpay').hide();">
									<input type="radio" name="paytype" value="2" {if intval($settings['paytype']) == 2}checked="checked"{/if}> Ping++支付接口
								</label>
								<span class="help-block">默认使用系统支付接口</span>
							</div>
						</div>
						<div id="pingxx" style="{if intval($settings['paytype']) != 2}display: none;{/if}">
							<div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">Ping++支付</label>
								<div class="col-xs-12 col-sm-8">
									<div class="alert alert-warning">
										<h4>微信支付授权目录</h4>
										<p>{$_W['siteroot']}app/</p><br />
										<h4>Webhooks接收 URL</h4>
										<p>{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&do=webhooks&m=weliam_indiana</p>
									</div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">应用 ID (App_ID)</label>
								<div class="col-xs-12 col-sm-8">
									<input type="text" name="App_ID" class="form-control" value="{$settings['App_ID']}" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">Live Secret Key</label>
								<div class="col-xs-12 col-sm-8">
									<input type="text" name="Secret_Key" class="form-control" value="{$settings['Secret_Key']}" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">Live Publishable Key</label>
								<div class="col-xs-12 col-sm-8">
									<input type="text" name="Publishable_Key" class="form-control" value="{$settings['Publishable_Key']}" />
								</div>
							</div>
							
							<div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">Ping++ 公钥</label>
								<div class="col-sm-8 col-xs-12">
									<textarea name="PUBLIC_KEY" class="form-control" cows="10">{$settings['PUBLIC_KEY']}</textarea>
									<span class="help-block">所有配置不得为空</span>
								</div>
							</div>
							<!-- 支付方式设置 -->
							<div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">支付宝支付</label>
								<div class="col-xs-12 col-sm-8" style="width: 33.3%;">
			                            <label class="radio radio-inline">
											<input type="radio" name="isalipay" value="1" {if $settings['isalipay']==1}checked="checked"{/if}> 关闭
										</label>
										<label class="radio radio-inline">
											<input type="radio" name="isalipay" value="2" {if $settings['isalipay']==2}checked="checked"{/if}> 开启
										</label>
									</div>
							</div>
							<div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">微信支付</label>
								<div class="col-xs-12 col-sm-8" style="width: 33.3%;">
			                            <label class="radio radio-inline">
											<input type="radio" name="iswxpay" value="1" {if $settings['iswxpay']==1}checked="checked"{/if}> 关闭
										</label>
										<label class="radio radio-inline">
											<input type="radio" name="iswxpay" value="2" {if $settings['iswxpay']==2}checked="checked"{/if}> 开启
										</label>
									</div>
							</div>
							<div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">京东钱包支付</label>
								<div class="col-xs-12 col-sm-8" style="width: 33.3%;">
			                            <label class="radio radio-inline">
											<input type="radio" name="isjdpay" value="1" {if $settings['isjdpay']==1}checked="checked"{/if}> 关闭
										</label>
										<label class="radio radio-inline">
											<input type="radio" name="isjdpay" value="2" {if $settings['isjdpay']==2}checked="checked"{/if}> 开启
										</label>
								</div>
							</div>
							<div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">百度钱包支付</label>
								<div class="col-xs-12 col-sm-8" style="width: 33.3%;">
			                            <label class="radio radio-inline">
											<input type="radio" name="isbfbpay" value="1" {if $settings['isbfbpay']==1}checked="checked"{/if}> 关闭
										</label>
										<label class="radio radio-inline">
											<input type="radio" name="isbfbpay" value="2" {if $settings['isbfbpay']==2}checked="checked"{/if}> 开启
										</label>
								</div>
							</div>
							<div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">是否开启提现功能</label>
								<div class="col-xs-12 col-sm-8" style="width: 33.3%;">
			                            <label class="radio radio-inline">
											<input type="radio" name="ispayee" value="1" {if $settings['ispayee']==1}checked="checked"{/if}> 关闭
										</label>
										<label class="radio radio-inline">
											<input type="radio" name="ispayee" value="2" {if $settings['ispayee']==2}checked="checked"{/if}> 开启
										</label>
								</div>
							</div>
							<!-- ping++登陆连接 -->
							<div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">ping++登陆</label>
								<a href="https://www.pingxx.com/" target="_blank">
								<div class="col-xs-12 col-sm-8">
									<input type="text" readOnly="true" class="form-control" value="https://www.pingxx.com" />
								</div>
								</a>
							</div>
						</div>
						<div id="wqpay" style="{if intval($settings['paytype']) != 1}display: none;{/if}">
							<div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">微信支付类型</label>
								<div class="col-sm-8 col-xs-12">
		                            <label class="radio radio-inline">
										<input type="radio" name="wxpaystatus" value="1" {if $settings['wxpaystatus']==1}checked="checked"{/if}> 系统微信支付
									</label>
									<label class="radio radio-inline">
										<input type="radio" name="wxpaystatus" value="2" {if $settings['wxpaystatus']==2}checked="checked"{/if}> 微信云支付
									</label>
									<span class="help-block">默认使用系统微信支付接口（使用系统微信支付可能导致您的微信支付接口被封，建议采用云支付）</span>
								</div>
							</div>
							<div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">云支付PID</label>
								<div class="col-sm-8 col-xs-12">
									<input type="text" name="yunpay_partner" class="form-control" value="{$settings['yunpay_partner']}" />
									<span class="help-block">功能选项-注意更新缓存一下</span>
								</div>
							</div>
	                        <div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">云支付KEY</label>
								<div class="col-sm-8 col-xs-12">
									<input type="text" name="yunpay_key" class="form-control" value="{$settings['yunpay_key']}" />
									
								</div>
							</div>
	                        <div class="form-group">
								<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">云支付账号</label>
								<div class="col-sm-8 col-xs-12">
									<input type="text" name="yunpay_seller_email" class="form-control" value="{$settings['yunpay_seller_email']}" />
								</div>
							</div>
						</div>
					</div>
					<!-- ping++支付参数设置结束 -->
					
					<!-- 关注参数设置开始 -->
					<div class="tab-pane" id="tab_followed">
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">关注二维码</label>
							<div class="col-sm-8">
								{php echo tpl_form_field_image('followed_image', $settings['followed_image']);}(建议430*430)
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">引导关注提示语</label>
							<div class="col-xs-12 col-sm-8">
								<input type="text" name="followed_message" class="form-control" value="{$settings['followed_message']}" />(建议少于15字)
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">未关注时能否购买</label>
							<div class="col-xs-12 col-sm-8" style="width: 33.3%;">
		                            <label class="radio radio-inline">
										<input type="radio" name="followed_isbuy" value="1" {if $settings['followed_isbuy']==1}checked="checked"{/if}> 能
									</label>
									<label class="radio radio-inline">
										<input type="radio" name="followed_isbuy" value="2" {if $settings['followed_isbuy']==2}checked="checked"{/if}> 不能         (默认能够买)
									</label>
							</div>
						</div>
						<div class="form-group">
				            <label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">邀请关注送积分</label>
							<div class="col-xs-12 col-sm-4 input-group" style="float: left;">
	                            <input type="text" name="credit1_followed" class="form-control" value="{$settings['credit1_followed']}">
	                            <span class="input-group-addon">积分</span>
                      		</div>	
                      		<div class="col-xs-12 col-sm-8" style="width: 33.3%;">
	                            <label class="radio radio-inline">
									<input type="radio" name="iscredit1_followed" value="1" {if $settings['iscredit1_followed']==1}checked="checked"{/if}> 关闭
								</label>
								<label class="radio radio-inline">
									<input type="radio" name="iscredit1_followed" value="2" {if $settings['iscredit1_followed']==2}checked="checked"{/if}> 开启(默认关闭)
								</label>
							</div>
                  		</div>
                  		<div class="form-group">
				            <label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">被邀请人关注送夺宝币</label>
							<div class="col-xs-12 col-sm-4 input-group" style="float: left;">
	                            <input type="text" name="duobao_followed" class="form-control" value="{$settings['duobao_followed']}">
	                            <span class="input-group-addon">夺宝币</span>(默认不送夺宝币)
                      		</div>	
                  		</div>
                  		<div class="form-group">
				            <label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">购买返积分（购买基数为1个夺宝币）</label>
							<div class="col-xs-12 col-sm-4 input-group" style="float: left;">
	                            <input type="text" name="buy_followed" class="form-control" value="{$settings['buy_followed']}">
	                            <span class="input-group-addon">积分</span>(默认不送积分)
                      		</div>	
                  		</div>
                  		
					</div>
					<!-- 关注参数设置结束 -->
					
				</div>
			</div>
		</div>
		<div class="form-group col-sm-12">
			<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
			<input type="hidden" name="token" value="{$_W['token']}" />
		</div>
	</form>
</div>
<script>
$(function () {
		window.optionchanged = false;
		$('#myTab a').click(function (e) {
			e.preventDefault();//阻止a链接的跳转行为
			$(this).tab('show');//显示当前选中的链接及关联的content
		})
	});
</script>
{template 'common/footer'}